﻿@model Scrumrun.Models.Project

@{
    ViewBag.Title = "EditSprints";
}

<h3>@Model.Name</h3>

<div class="row mainwrapper">
    <div class="span2">
        <ul class="unstyled">
            <li>
                @*@Html.ActionLink("Project", "Details", "Project", new { id = ViewBag.CurrentProject }, new { @class="btn btn-warning"} )*@
                <a class="btn btn-warning" href="@Url.Action("Details", "Project", new { id = Model.ProjectId })">
                    <i class="icon-th-large icon-white"></i>Project
                </a>
            </li>
            <li>&nbsp;</li>
            <li>
                @Html.ActionLink("View Backlog", "index", "Backlog", new { ProjectId = Model.ProjectId }, new { @class = "btn btn-info" })
            </li>
            <li>&nbsp;</li>
            <li>
                @Html.ActionLink("View Board", "SprintBoard", "Sprint", new { ProjectId = Model.ProjectId }, new { @class = "btn btn-primary" })
            </li>
        </ul>
    </div>
    <!--sidebar-->

    <div class="span10">
        <div class="contentwrap">
            <h4>Sprint Settings</h4>

            <div class="alert alert-block"><button type="button" class="close" data-dismiss="alert">&times;</button>
                <h5>Warning!</h5>
             30 days of iteration period is standard in scrum development. However you can change it to meet your requirements.
             Past and current sprints will not be affected. New iteration period will only effect future sprints.
                Userstories set to future sprints will reset and you will have to re-assign them again.
            </div>             

            @using (Ajax.BeginForm("EditSprints", null, new AjaxOptions
                {
                    HttpMethod = "Post",
                    InsertionMode = InsertionMode.Replace,
                    UpdateTargetId = "SprintTable"
                }, new { @Class = "form-horizontal" }))
            {
                <fieldset>
                    <legend>Project</legend>

                    @Html.HiddenFor(model => model.ProjectId)

                    <div class="control-group">
                        @Html.LabelFor(model => model.NumOfIterationDay, new { @Class = "control-label" })

                        <div class="controls">
                            @Html.EditorFor(model => model.NumOfIterationDay) (It can be from 2 days to 60 days)
                            @Html.ValidationMessageFor(model => model.NumOfIterationDay)
                        </div>
                    </div>

                    <div class="control-group">
                        @Html.LabelFor(model => model.WorkingDaysOnly, new { @Class = "control-label" })

                        <div class="controls">
                            @Html.EditorFor(model => model.WorkingDaysOnly)
                            @Html.ValidationMessageFor(model => model.WorkingDaysOnly)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="controls">
                            <input type="submit" value="Save" class="btn btn-warning" />
                        </div>
                    </div>
                </fieldset>
            }

            <div id="SprintTable">

                @Html.Partial("_SprintTable", Model.Sprints)

            </div>

        </div>
    </div>
</div>
